package com.atguigu.vod.Utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantVodUtils implements InitializingBean {

    //读取配置文件中的值
    @Value("${aliyun.vod.file.keyid}")
    private String keyid;
    //读取配置文件中的值
    @Value("${aliyun.vod.file.keysecret}")
    private String keysecret;

    //把读取到的内容注入在这里
    public static String ACCESS_KEY_SECRET;
    public static String ACCESS_KEY_ID;

    @Override
    public void afterPropertiesSet() throws Exception {
        //小写字母的注入到大写字母
        ACCESS_KEY_ID = keyid;
        ACCESS_KEY_SECRET = keysecret;
    }
}